#ifndef CALCULATORPROCESSINGMESSAGE_H
#define CALCULATORPROCESSINGMESSAGE_H

#include <QObject>
#include <QStack>

#define MAXSIZE 100

class CalculatorProcessingMessage : public QObject
{
    Q_OBJECT
public:
    explicit CalculatorProcessingMessage(QObject *parent = 0);
    
signals:
    void display(QString);
    void DisplayResult(QString);
    void displayBackSpace(QString);
    void DisplayError(QString);

//public slots:
public:
    void Acceptedclick(QString);
    int AcceptedEqual(QString);
    void AcceptedBackSpace(QString);

    void Clear();

    void push(double src) ;
    double pop() ;
    double top() ;
    int isEmpty();
    bool isOperator(QByteRef) ;
    int inToPost() ;
    int cmpOperator(int o1,int o2) ;
    double value() ;
    bool isDigital(QByteRef);
    void cancel_end();

private:
    double m_stack[MAXSIZE + 1];
    int m_position;

    QByteArray m_infix;
    QByteArray m_postfix;
};

#endif // CALCULATORPROCESSINGMESSAGE_H
